import React from "react";
import { View, Image } from "@tarojs/components";
import "./card_scroll_item.scss";
import DefaultImage from "../../images/index/default_card.png";

const CardScrollItem = ({
  url,
  title = "测试标题",
  other = "test",
  customStyle,
  customImageStyle,
  footer,
  onClick
}) => {
  return (
    <View className="card-scroll-item" style={customStyle} onClick={onClick}>
      <Image
        className="cover"
        src={url ? url : DefaultImage}
        style={customImageStyle}
      />
      <View className="item-content">
        <View className="title">{title}</View>
        <View className="other">{other}</View>
      </View>
      {footer && <View className="footer">{footer}</View>}
    </View>
  );
};

export default CardScrollItem;
